<?php
    require_once("incl/functions/projects.php");
    $proj = new projects();
    
    if(isset($_GET['projID'])){
        $project = $proj->getProject($_GET['projID']);

        echo($project[0] . '<br /><br />' . 
        $project[1] . '
            <table border="1"> 
            	<tr>
		<td>
			' . DICT_DEV . ': 
		</td>
		<td>
			Leander Molegraaf
		</td>
	</tr>
	<tr>
		<td>
			' . DOWN_CLIENT . ':
		</td>
		<td>
			none
		</td>
	</tr>
	<tr>
		<td>
			latest version:
		</td>
		<td>
			v1.2.5
		</td>
	</tr>
	<tr> ');
        if($project[5] !== null){
            echo('
		<td colspan="2" align="right">
			<a href="Extra/Projecten/source.zip"> Download </a>
		</td>
            </tr>');
        }
    echo('</table>');
    
        $img = $proj->getProjectImages($_GET['projID']);
        $imgCount = count($img);
        echo('<div class="ImgSlider"> ');

        for($nummer = 0;$nummer<$imgCount;$nummer++){
            echo('<a href="' . $img[$nummer][0] . '" class="slideableImage" rel="lightbox[' . $project[0] . ']" title="' . $img[$nummer][1] . '"><img src="' . $img[$nummer][0] . '" width=' . $img[$nummer][3] . ' height=' . $img[$nummer][3] . ' id="slideImg' . $nummer . '" onmouseover="scaleimg(' . $nummer . ',1)" onmouseout="scaleimg(' .$nummer . ',0)"></a>');
        }
        echo('</div>');
    }
    else{
        $projList = $proj->getProjectList();
        $projcount = count($projList);

        for($nummer = 0;$nummer<$projcount;$nummer++){
            echo('<table border="1" width="510">
                    <tr>
                            <td colspan="2" align="center">
                                    <a href="' . $_SERVER['PHP_SELF'] . '?page=project&projID=' . $projList[$nummer][0] . '"> ' . $projList[$nummer][1] . ' </a><br />

                            </td>
                    </tr>
                    <tr>
                            <td>
                                    ' . DICT_DEV . '
                            </td>
                            <td>
                                    ' . $projList[$nummer][2] . '
                            </td>
                    </tr>
                    <tr>
                            <td>
                                    ' . DICT_CLIENT . '
                            </td>
                            <td>
                                    ' . $projList[$nummer][3] . '
                            </td>
                    </tr>
                    <tr>
                            <td>
                                    ' . DICT_LATEST . ':
                            </td>
                            <td>
                                    ' . $projList[$nummer][4] . '
                            </td>
                    </tr>
                    <tr>
                            <td>
                                    ' . DICT_DESC . '
                            </td>
                            <td>
                                    <a href="' . $_SERVER['PHP_SELF'] . '?page=project&projID=' . $projList[$nummer][0] . '"> link </a>
                            </td>
                    </tr>');
                    if($projList[$nummer][6] !== null){
                        echo('<tr> 
                                <td colspan="2" align="right">
                                        <a href="' . $projList[$nummer][6] . '"> Download </a>
                                </td>
                        </tr>');
                    }
                    echo('</table><br /><br />');
        }
    }
?>